package com.taptech.doufu.util;

/**
 * Created by longsiyang on 16/4/28.
 */
public class URLParseUtils {
    public static String parseA(String url) {
        String tempSting = "";
        tempSting = url.substring(url.lastIndexOf("index.php") + 1, url.lastIndexOf("?"));
        tempSting = tempSting.replace("?", "_");
        tempSting = tempSting.replace("/", "_");
        tempSting = tempSting.replace(".", "_");
        return tempSting;
    }

    public static String parseB(String url) {
        String tempSting = "";
        if (url.contains("&")) {
            tempSting = url.substring(url.lastIndexOf("index.php") + 1, url.indexOf("&"));
        } else {
            tempSting = url.substring(url.lastIndexOf("index.php") + 1, url.length());
        }
        tempSting = tempSting.replace("?", "_");
        tempSting = tempSting.replace("/", "_");
        tempSting = tempSting.replace(".", "_");
        return tempSting;
    }

}
